package com.gdkm.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import com.gdkm.po.Doctor;
import com.gdkm.po.Student;

@Repository
@Mapper
public interface DoctorDao {
	 @Insert("insert into doctor(doctor_name,doctor_sex) "
		 		+ "values(#{doctor_name},#{doctor_sex})")
		 void save1(String doctor_name, String doctor_sex);
	
	
	@Select("SELECT * FROM doctor WHERE doctor_name LIKE concat('%',#{doctor_name},'%') && doctor_sex LIKE concat('%',#{doctor_sex},'%') limit #{y},#{ge}")
	List<Doctor> list3(String doctor_name,String doctor_sex,int y,int ge);
	
	 @Select("SELECT * FROM doctor  limit #{y},#{ge}")
	 List<Doctor> list2(int y,int ge);
	 @Update("UPDATE  doctor set doctor_name=#{doctor_name},doctor_sex=#{doctor_sex} where id=#{id}")
	 void update(Doctor stu);
	 @Delete("DELETE FROM doctor where id=#{id}")
		void delete1(int id);
	 
	
}
